package com.watson.activity;

import android.os.Bundle;
import android.widget.Switch;
import android.widget.TextView;

import com.watson.BaseActivity;
import com.watson.R;
import com.watson.utils.SPUtils;

public class ArgumentActivity extends BaseActivity {
    private TextView tvTitle;
    private Switch sw_cedan_t, sw_cedan, sw_zufei, sw_chuku, sw_lianhuo, sw_xindan, sw_jixing;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_argument);
        statusbar4();
        tvTitle = findViewById(R.id.tvTitle);
        sw_cedan_t = findViewById(R.id.sw_cedan_t);
        sw_cedan = findViewById(R.id.sw_cedan);
        sw_zufei = findViewById(R.id.sw_zufei);
        sw_chuku = findViewById(R.id.sw_chuku);
        sw_lianhuo = findViewById(R.id.sw_lianhuo);
        sw_xindan = findViewById(R.id.sw_xindan);
        sw_jixing = findViewById(R.id.sw_jixing);
        tvTitle.setText(R.string.argument);
        findViewById(R.id.imgBack).setOnClickListener(v -> finish());
        sw_cedan_t.setChecked((Boolean) SPUtils.get(mContext, "sw_cedan_t", true));
        sw_cedan.setChecked((Boolean) SPUtils.get(mContext, "sw_cedan", true));
        sw_zufei.setChecked((Boolean) SPUtils.get(mContext, "sw_zufei", true));
        sw_chuku.setChecked((Boolean) SPUtils.get(mContext, "sw_chuku", true));
        sw_lianhuo.setChecked((Boolean) SPUtils.get(mContext, "sw_lianhuo", true));
        sw_xindan.setChecked((Boolean) SPUtils.get(mContext, "sw_xindan", true));
        sw_jixing.setChecked((Boolean) SPUtils.get(mContext, "sw_jixing", true));
        sw_cedan_t.setOnCheckedChangeListener((buttonView, isChecked) -> SPUtils.put(mContext, "sw_cedan_t", isChecked));
        sw_cedan.setOnCheckedChangeListener((buttonView, isChecked) -> SPUtils.put(mContext, "sw_cedan", isChecked));
        sw_zufei.setOnCheckedChangeListener((buttonView, isChecked) -> SPUtils.put(mContext, "sw_zufei", isChecked));
        sw_chuku.setOnCheckedChangeListener((buttonView, isChecked) -> SPUtils.put(mContext, "sw_chuku", isChecked));
        sw_lianhuo.setOnCheckedChangeListener((buttonView, isChecked) -> SPUtils.put(mContext, "sw_lianhuo", isChecked));
        sw_xindan.setOnCheckedChangeListener((buttonView, isChecked) -> SPUtils.put(mContext, "sw_xindan", isChecked));
        sw_jixing.setOnCheckedChangeListener((buttonView, isChecked) -> SPUtils.put(mContext, "sw_jixing", isChecked));
    }
}
